# useage: gunicorn -c gunicorn.py run:app
import os

import gevent.monkey
import multiprocessing

from dotenv import load_dotenv

load_dotenv()

gevent.monkey.patch_all()

debug = True
loglevel = 'debug'
bind = ':'.join([os.getenv('FLASK_RUN_HOST'), os.getenv('FLASK_RUN_PORT')])
pidfile = "logs/gunicorn.pid"
accesslog = "logs/access.log"
errorlog = "logs/debug.log"
# 千万别改成True，否则supervisor无法控制
daemon = False

# 启动的进程数
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = 'gevent'
x_forwarded_for_header = 'X-FORWARDED-FOR'
